package cn.wolfcode.enums;

import lombok.Getter;

/**
 * @author JMJ
 * @date 2021/1/14 17:18
 */
@Getter
public enum SubjectTitleEnum {
    SINGLE("一. 单选题", 1),
    MULTI("二. 多选题", 2),
    JUDGE("三. 判断题", 3);


    private String name;
    private Integer value;

    private SubjectTitleEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value) {
        //获取所有实例
        SubjectTitleEnum[] enums = values();
        for (SubjectTitleEnum anEnum : enums) {
            if (anEnum.value.equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }

}
